﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    Inherits="Nivdal.ForumDetails" Title="" StylesheetTheme="SkinFile" CodeBehind="ForumDetails.aspx.cs" %>

<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:HyperLink ID="ForumHomePage" runat="server" Text='<%# Resources.Resource.Global_Forum+ ">>"%>'
        CssClass="PageNameContentStyle" NavigateUrl="~/ForumHomePage.aspx"></asp:HyperLink>
    &nbsp;
    <asp:Label ID="ForumNameLabel" runat="server" CssClass="PageNameContentStyle"></asp:Label>
    &nbsp;
    <asp:Label ID="PageName2Label" runat="server" Text="<%$ Resources:Resource, ForumDetails_PageName2Label %>" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="basic_element">
    <div class="red_title">
        <asp:HyperLink ID="ForumHomePage2" runat="server" Text='<%# Resources.Resource.Global_Forum+ ">>"%>'
        CssClass="white_title" NavigateUrl="~/ForumHomePage.aspx"></asp:HyperLink>
        &nbsp;
        <asp:Label ID="ForumNameLabel2" runat="server" CssClass="white_title"></asp:Label>
        &nbsp;
        <asp:Label ID="PageName2Label2" runat="server" Text="<%$ Resources:Resource, ForumDetails_PageName2Label %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <asp:Label ID="MessageLabel" runat="server" Text="" SkinID="GreenSmallHeaderLabel"></asp:Label>
        <asp:HiddenField ID="ForumIdHiddenField" runat="server" />
        <div class="antifloater">
            <asp:Hyperlink ID="ToTorumAdminPageLinkButton" runat="server" SkinID="GreenTitleHyperLink"
            Text="<%$ Resources:Resource, ForumDetails_ToTorumAdminPageLinkButton %>" Visible="false"> </asp:Hyperlink>
            &nbsp;
            <asp:Button ID="BecomeForumAdminLinkButton" runat="server" Text="<%$ Resources:Resource, ForumDetails_BecomeForumAdminLinkButton %>"
               CssClass="GreenSmallButtonStyle" Visible="false" />
            &nbsp;
            <asp:Hyperlink ID="ForumMembersLinkButton" runat="server" Text="<%$ Resources:Resource, ForumDetails_ForumMembersLinkButton %>"
                SkinID="GreenTitleHyperLink" Visible="false"></asp:Hyperlink>
        </div>
        <asp:FormView ID="ForumDetailsFormView" runat="server" DataSourceID="ForumDetailsSqlDataSource" Width="100%">
            <ItemTemplate>
                    
                    <table>
                        <tr>
                            <td>
                                <asp:Label ID="NumberOfThreadsTitleLabel" runat="server" Text="<%$ Resources:Resource, ForumDetails_NumberOfThreadsTitleLabel %>"
                                    SkinID="InfoLabel"></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="NumberOfThreadsLabel" runat="server" Text='<%# Eval("NumUsers") %>'
                                    SkinID="InfoLabel" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="NumberOfForumUsersTitleLabel" runat="server" Text="<%$ Resources:Resource, ForumDetails_NumberOfForumUsersTitleLabel %>"
                                    SkinID="InfoLabel"></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="NumThreadsLabel" runat="server" Text='<%# Eval("NumThreads") %>' SkinID="InfoLabel" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="NumPostsTitleLabel" runat="server" Text="<%$ Resources:Resource, ForumDetails_NumPostsTitleLabel %>"
                                    SkinID="InfoLabel"></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="NumPostsLabel" runat="server" Text='<%# Eval("NumPosts") %>' SkinID="InfoLabel"></asp:Label>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <asp:Label ID="PublicInfoTitleLabel" runat="server" Text="<%$ Resources:Resource, ForumDetails_PublicInfoTitleLabel %>"
                        SkinID="InfoLabel"></asp:Label>
                    <br />
                    <asp:Label ID="PublicInfoLabel" runat="server" Text='<%# Eval("PublicInfo") %>' SkinID="GridLabel"></asp:Label>
                    <br />
                    <asp:Panel ID="Panel1" runat="server" Visible='<%# Eval("PrivateInfoVisible") %>'>
                        <asp:Label ID="PrivateInfoTitleLabel" runat="server" Text="<%$ Resources:Resource, ForumDetails_PrivateInfoTitleLabel %>"
                            SkinID="InfoLabel"></asp:Label>
                        <br />
                        <asp:Label ID="PrivateInfoLabel" runat="server" Text='<%# Eval("PrivateInfo") %>'
                            SkinID="GridLabel" ToolTip="<%$ Resources:Resource, ForumDetails_PrivateInfoLabel %>"></asp:Label>
                    </asp:Panel>
                    <br />
                
            </ItemTemplate>
        </asp:FormView>
        <asp:Button ID="MarkAllAsReadButton" runat="server" Text="<%$ Resources:Resource, Global_MarkAllAsRead %>"
            message="<%$ Resources:Resource, ForumDetails_MarkAllAsReadButtonOnClientClick %>"
            CssClass="GreenSmallButtonStyle antifloater" OnClientClick='return confirm(this.getAttribute("message"))'
            OnClick="MarkAllAsRead"  />
        <asp:SqlDataSource ID="ForumDetailsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_ForumGetForumDetails" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:Button ID="CreateNewThreadButton" runat="server" Text="<%$ Resources:Resource, ForumDetails_CreateNewThreadButton %>"
            ToolTip="<%$ Resources:Resource, ForumDetails_CreateNewThreadButtonToolTip %>"
            OnClick="CreateNewThreadButton_Click" CssClass="ForumButtonWithIconStyle" />
    </div></div>
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="ActiveThreadsLabel" runat="server" Text="<%$ Resources:Resource, ForumDetails_ActiveThreadsLabel %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">

    
        <asp:GridView ID="ForumThreadsGridView" AutoGenerateColumns="False" DataSourceID="GetForumThreadsSqlDataSource"
            runat="server" SkinID="FrumGrid" AllowPaging="True" PageSize="75">
            <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
            <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="ForumNameLabel" runat="server" Text="<%$ Resources:Resource, ForumDetails_ForumNameLabel %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <div style="padding-left: 10px;">
                            <div style="padding-right: 10px; padding-left: 10px; display: inline;">
                                <asp:Image ID="IsClosedIcon" runat="server" ImageUrl='<%# IconName(Eval("IsClosed"), Eval("IsSticky")) %>'
                                    ToolTip='<%# ThreadIconToolTip(Eval("IsClosed"), Eval("IsSticky") ) %>' />
                            </div>
                            <asp:HyperLink ID="ForumThreadsHyperLink" runat="server" Text='<%# Eval("ThreadName") %>'
                                NavigateUrl='<%# Eval("ThreadId", "ThreadDetails.aspx?ThreadId={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                        </div>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Posts">
                    <ItemTemplate>
                        <asp:Label ID="NumUnreadPostsLabel" runat="server" Text='<%# Eval("NumUnreadPosts")%>'
                            SkinID="GreenGridLabel" Visible='<%# Eval("UnreadPostsExist") %>'> </asp:Label>
                        <asp:Label ID="SlashLabel" runat="server" Text="/" SkinID="GridLabel" Visible='<%# Eval("UnreadPostsExist") %>'></asp:Label>
                        <asp:Label ID="NumberOfPostsLabel" runat="server" Text='<%# Eval("NumberOfPosts")%>'
                            SkinID="GridLabel"> </asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_LastPost %>">
                    <ItemTemplate>
                        <asp:Label ID="LastPostDateLabel" runat="server" Text='<%# Eval("LastPostDate")%>'
                            SkinID="GridLabel"> </asp:Label>
                        <br />
                        <asp:Label ID="ByLabel" runat="server" Text="<%$ Resources:Resource, Global_By %>"
                            SkinID="GridLabel"></asp:Label>
                        <asp:HyperLink ID="LastPostUserNameHyperLink" runat="server" Text='<%# Eval("LastPostUserName") %>'
                            NavigateUrl='<%# Eval("LastPostUserId", "UserPage.aspx?Id={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                        <asp:Image ID="IsPremiumImage" runat="server" ImageUrl="~/Images/Icons/premium.png"
                            Visible='<%# Eval("IsPremium") %>' ToolTip="<%$ Resources:Resource, Global_PremiumUser %>" />
                        <asp:Image ID="InOnlineImage" runat="server" ToolTip="<%$ Resources:Resource, Global_Online %>"
                            ImageUrl="~/Images/Icons/IsOnline.png" Visible='<%# Eval("IsOnline") %>' />
                        <asp:Image ID="OfflineImage" runat="server" ToolTip="<%$ Resources:Resource, Global_Offline %>"
                            ImageUrl="~/Images/Icons/offline.png" Visible='<%# !((bool)Eval("IsOnline")) %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="NoDataLabel" runat="server" Text="<%$ Resources:Resource, ForumDetails_NoDataLabel %>"></asp:Label>
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="GetForumThreadsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_ForumGetForumThreads" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <br />
        <br />
        <div style="width:100%; text-align:center;">
            <asp:HyperLink ID="ForumHomePageHyperlink" runat="server" Text="<%$ Resources:Resource, ForumDetails_ForumHomePageHyperlink %>"
                SkinID="GreenTitleHyperLink" NavigateUrl="~/ForumHomePage.aspx"></asp:HyperLink>
            &nbsp;&nbsp;&nbsp;
            <asp:HyperLink ID="MyConversationsHyperlink" runat="server" Text="<%$ Resources:Resource, Global_MyConversations %>"
                SkinID="GreenTitleHyperLink" NavigateUrl="~/ForumConversations.aspx"></asp:HyperLink>
            <br /><br />
            <asp:Button ID="LeaveThisForumButton" runat="server" Text="<%$ Resources:Resource, ForumDetails_LeaveThisForumButton %>"
              OnClick="LeaveThisForumButton_Click" ToolTip="<%$ Resources:Resource, ForumDetails_LeaveThisForumButtonToolTip %>" CssClass="GreenSmallButtonStyle" />
        </div>
    </div>
    </div>
    
</asp:Content>
